package object;

public class ObjectDemo {
    public static void main(String[] args) {
        //toString演示
        /*
        Point p = new Point(100, 200);
        System.out.println(p);
        System.out.println(p.toString());

        String str = "这是一个点" + p;
        System.out.println(str);
         */

        //equals演示
        /*
        Point point = new Point(100, 200);
        Point point1 = new Point(100, 200);
        System.out.println(point == point1);//false
        System.out.println(point.equals(point1));//true
         */

        String string=new String("hello");
        String string1=new String("hello");
        System.out.println(string.equals(string1));

        StringBuilder stringBuilder=new StringBuilder("hello");
        StringBuilder stringBuilder1=new StringBuilder("hello");
        System.out.println(stringBuilder.equals(stringBuilder1));

        System.out.println(string.equals(stringBuilder));
    }


}
